const express= require("express")
let app = express()

let middleWare1 = function(req,res,next){
    req.money =100;
    console.log(1111);
    next()
    console.log(111+"end")
}
let middleWare2 = function(req,res,next){
    req.money =100;
    console.log(222);
    next()
    console.log(222+"end")
}

let middleWare3 = function(req,res,next){
    req.money =100;
    console.log(333);
    next()
    console.log(333+"end")
}

app.use(middleWare1)  //中间件的执行是洋葱模型
app.use(middleWare2)
app.use(middleWare3)


app.get("/",(req,res)=>{
    res.send("执行完毕")
})

app.listen(8989)